﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="List.aspx.vb" Inherits="CricketForum.List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <h1>
            List of International Cricketers
        </h1>
    </div>
    <div class="RssFeed">
        RSS Feed
        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Pictures/General/Feed-icon.jpeg"
            ToolTip="RSS Feed" Width="20px" Height="20px" />
    </div>
    <div>
        <table width="920px">
            <tr>
                <td>
                    <h3>
                        Search Content By
                    </h3>
                    <asp:Label ID="Label2" runat="server" Text="Nation"></asp:Label>
                    <asp:DropDownList ID="ddlNation" runat="server" DataTextField="Nation" DataValueField="ID"
                        Style="font-family: normal 12px verdana, arial, helvetica, sans-serif;">
                    </asp:DropDownList>
                    <asp:Label ID="Role" runat="server" Text="Role"></asp:Label>
                    <asp:DropDownList ID="ddlRole" runat="server" DataTextField="Role" DataValueField="Role">
                    </asp:DropDownList>
                    <asp:Button ID="btnSearch" runat="server" Text="Search" />
                    <asp:Button ID="btnClearSearch" runat="server" Text="Clear Search" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <p>
            <asp:GridView ID="gvPlayers" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                Width="100%" >
                <EmptyDataTemplate>
                    No Data Found.
                </EmptyDataTemplate>
                <HeaderStyle CssClass="H1" />
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="SL NO" SortExpression="ID" />
                    <asp:HyperLinkField DataTextField="Name" HeaderText="Player Name" SortExpression="Name"
                        DataNavigateUrlFields="ID" DataNavigateUrlFormatString="Details.aspx?ID={0}" />
                    <asp:TemplateField HeaderText="Nation" SortExpression="Nation">
                        <ItemTemplate>
                            <asp:Image ID="NationFlag" runat="server" ImageUrl='<%# Eval("NationFlag") %>' Width="40px"
                                Height="20px" ImageAlign="Middle" />
                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "http://maps.google.co.uk/maps?q=" + Eval("Nation") %>'
                                Target="_blank">
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Nation") %>'></asp:Label>
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" DataFormatString="{0:MMMM d, yyyy}"
                        HtmlEncode="false" />
                    <asp:BoundField DataField="Role" HeaderText="Role" SortExpression="Role" />
                    <asp:ImageField DataImageUrlField="PlayerPhoto" HeaderText="Player Picture">
                        <ControlStyle Height="100px" Width="150px" />
                    </asp:ImageField>
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="CricketPlayersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStringWorldsCricket %>"
                ProviderName="<%$ ConnectionStrings:ConnStringWorldsCricket.ProviderName %>"
                SelectCommand="SELECT Player.Name, Player.DOB, Player.Nickname, Player.BattingStyle, Player.BowlingStyle, Player.Role, Player.PlayerPhoto, InternationalCricketTeams.NationFlag, InternationalCricketTeams.Nation, Player.ID, InternationalCricketTeams.TeamLogo FROM (InternationalCricketTeams INNER JOIN Player ON InternationalCricketTeams.ID = Player.Nation)">
            </asp:SqlDataSource>
         
        </p>
      
        
      
    </div>
</asp:Content>
